export function testArray() {
  const arr2: Array<number> = [];
  arr2.push(1)
  arr2.push(2)
  arr2.push(3)
  arr2[0] = 6
  delete arr2[1]
  arr2.forEach((value, index) => {
    console.log("testArray", value)
  })
}

export function testAddArray() {
  let arr1 = [1, 2]
  let arr2 = [3, 4, 5]
  let arr3 = [...arr1, ...arr2]
  arr3.forEach((value) => {
    console.log("testAddArray", value)
  })
}

function testOnlyReadArray() {
  let arr1: readonly number[] = [1, 2]
  //arr1[1] = 0 报错，因为数组是只读的
  //delete arr1[0] 报错，因为数组是只读的
}

enum ColorEnum {
  Red,
  Blue = 1,
  Black
}

enum Enum {
  A,
  B,
  C = "C",
  D = "D",
  E = 8,
  F,
}

enum EnumStr {
  Str1 = 'a',
  Str2 = 'b'
}

export function testEnum() {
  console.log('testEnum', ColorEnum.Red)
  console.log('testEnum', ColorEnum.Blue)
  console.log('testEnum', ColorEnum.Black)

  console.log('testEnum', Enum.A)
  console.log('testEnum', Enum.B)
  console.log('testEnum', Enum.C)
  console.log('testEnum', Enum.D)
  console.log('testEnum', Enum.E)
  console.log('testEnum', Enum.F)

  console.log('testEnum', EnumStr.Str1)
  console.log('testEnum', EnumStr.Str2)

}

